#ifndef FENETRECONNEXION_H
#define FENETRECONNEXION_H

#include "include.h"

class FenetreConnexion: public QDialog
{
    Q_OBJECT

public:
    FenetreConnexion(QWidget *parent = 0);

    QString driverName() const;
    QString databaseName() const;
    QString userName() const;
    QString password() const;
    QString hostName() const;
    int port() const;
    bool utiliseDBPredefinie() const;

    QVBoxLayout *vbPrincipale;
    QGroupBox *connGroupBox;
    QFormLayout *formLayout;
    QComboBox *comboDriver;
    QLineEdit *editDatabase;
    QSpinBox *portSpinBox;
    QLineEdit *editPassword;
    QLineEdit *editUsername;
    QLineEdit *editHostname;
    QHBoxLayout *hbBddPredefinie;
    QSpacerItem *spacer1;
    QCheckBox *cbBddPredefinie;
    QHBoxLayout *hbButton;
    QSpacerItem *spacer2;
    QPushButton *okButton;
    QPushButton *cancelButton;

    void setupUi();

private slots:
    void on_okButton_clicked();
    void on_cancelButton_clicked() { reject(); }
    void on_cbBddPredefinie_clicked() { connGroupBox->setEnabled(!cbBddPredefinie->isChecked()); }
    void showEvent(QShowEvent*);
};

#endif
